/* ====================================================================
 * (#)Header: TransactionalCallerBean.java
 * (#)Revision: 
 * (#)Date Created: Aug 27, 2009 1:12:50 AM
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */
package com.karolak.service.ejb;

import java.util.concurrent.Callable;

import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;

/**
 * 
 * <code>TransactionalCallerBean</code> is ....
 * 
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */

@Stateless
@Local(value = Caller.class)
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class TransactionalCallerBean implements Caller {

	// === transactional wrapper - to make a call from transaction === //
	public <V> V call(Callable<V> callable) throws Exception {
		return callable.call();
	}

}
